POV-Ray : Newsgroups : povray.newusers : Calling 'procedures' with variables? : Calling 'procedures' with variables? Server Time
5 Sep 2024 14:18:32 EDT (-0400)
  Calling 'procedures' with variables?  
From: Simon de Vet
Date: 29 Aug 2000 17:10:53
Message: <39AC2738.5D9668D1@istar.ca>
I've created a pigment type which depends on a variable, n. If I
#declare n before the pigment code, it runs correctly.

However, I would like to be able to call this pigment type many times,
with different values of n. I thought that I could simply remove the
#declare before the pigment code, and use the code like:

texture { #declare n=1
              PigmentName
            }
texture { #declare n=2
              PigmentName
            }

However, POV complains that n is undefined when it first encounters the
code.

How can I use the pigment code as a procedure, called with the variable?
I've tried #macro, but haven't gotton anything working.

Thanks!


Simon


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.